package com.spddr.pmos.repos;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.spddr.pmos.jpa.User;

public interface UserRepos extends JpaRepository<User, Long> {

//	User findByUsernameIgnoringCase(String username);

	@Modifying(clearAutomatically = true)
	@Transactional
	@Query("UPDATE User SET password = ?#{[1]} WHERE id = ?#{[0]}")
	void updatePassword(long id, String password);
}
